const app = getApp();
var util = require('../../../utils/util.js')
var http = require('../../../utils/server.js')
var time = require('../../../utils/timeUtils.js')

Page({
  data: {},
  onLoad: function() {
    var ui = wx.getStorageSync('userInfo');
    this.setData({
      userInfo: ui
    })

  },
  onShow: function() {
    this.getData()
  },
  getData: function() {
    var that = this;
    http.post({
      url: "Index/getNotice",
      limit: 30
    }, function(data) {
      console.log('消息', data)
      that.processData(data);
      that.setData({
        list: data
      });

    })
  },
  processData: function(data) {
    var t = Math.floor(new Date().getTime() / 1000);
    for (var i in data) {
      data[i].t = time.formatMsgTime(data[i].time);
    }
  }
})